package com.jason.kotlin.meta.architecture2.repository

import com.jason.kotlin.meta.architecture2.api.HomeService
import com.jason.kotlin.meta.architecture2.model.*

/**
 * 首页相关api的数据获取实现
 *
 * @property service HomeService
 * @constructor
 */
class HomeApiImpl(private val service: HomeService) : HomeApi {


    override suspend fun getBanners(): WanApiResponse<List<BannerBean>> = service.getBanners()

    override suspend fun getArticles(page: Int): WanApiResponse<WanApiPageResponse<ArticleBean>> =
        service.getArticles(page)

    override suspend fun getFriendSites(): WanApiResponse<List<FriendSiteBean>> =
        service.getFriendSites()

    override suspend fun getHotKey(): WanApiResponse<List<HotKeyBean>> = service.getHotKey()

    override suspend fun getTopArticles(): WanApiResponse<List<ArticleBean>> =
        service.getTopArticles()
}